package com.huawei.bigdata.flink.examples.model;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;

/*
1eh9z4p09d  ,             20190527, 103557,  008768,  日用品,   沐浴露,   4.3,   mp4,             1eh9z4p09d00876820190527
 交易码(10位数字字母组合), 日期、   交易时间，账户号，商品类型，商品名称，金额，文件类型(mp4/jpg),  流水号
 transaction_code         date     time       account  product_type product_name  price  file_type  serial_number




 冠字号（XX00000001）、版别（2015版、2005版、1999版）、券别（100元、50元）、图片名
 Crown font number (XX00000001), edition (2015 edition, 2005 edition, 1999 edition), coupon (100 yuan, 50 yuan), picture name
**/
public  class VoucherRecord implements Serializable {
    public VoucherRecord(String crownfontNumber, String edition, String coupon, String pictureName, String pictureData) {
        this.crownfontNumber = crownfontNumber;
        this.edition = edition;
        this.coupon = coupon;
        this.pictureName = pictureName;
        try {
            this.pictureData = pictureData.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } finally {
        }
    }


    private String crownfontNumber;
    private String edition;
    private String coupon;
    private String pictureName;
    private byte[] pictureData;


    public String getCrownfontNumber() {
        return crownfontNumber;
    }

    public void setCrownfontNumber(String crownfontNumber) {
        this.crownfontNumber = crownfontNumber;
    }

    public String getEdition() {
        return edition;
    }

    public void setEdition(String edition) {
        this.edition = edition;
    }

    public String getCoupon() {
        return coupon;
    }

    public void setCoupon(String coupon) {
        this.coupon = coupon;
    }

    public String getPictureName() {
        return pictureName;
    }

    public void setPictureName(String pictureName) {
        this.pictureName = pictureName;
    }

    public byte[] getPictureData() {
        return pictureData;
    }

    public void setPictureData(byte[] pictureData) {
        this.pictureData = pictureData;
    }


//
//    @Override
//    public String toString() {
//        return "VoucherRecord{" +
//                "transaction_code='" + transaction_code + '\'' +
//                ", date='" + date + '\'' +
//                ", time='" + time + '\'' +
//                ", account='" + account + '\'' +
//                ", product_type='" + product_type + '\'' +
//                ", product_name='" + product_name + '\'' +
//                ", price='" + price + '\'' +
//                ", file_type='" + file_type + '\'' +
//                ", serial_number='" + serial_number + '\'' +
//                '}';
//    }

    @Override
    public String toString() {
        return "VoucherRecord{" +
                "crownfontNumber='" + crownfontNumber + '\'' +
                ", edition='" + edition + '\'' +
                ", coupon='" + coupon + '\'' +
                ", pictureName='" + pictureName + '\'' +
                ", pictureData=" + Arrays.toString(pictureData) +
                '}';
    }

}